<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //求字符串出现的个数
        let srt='alkdjladfjjdkksjalkfkd'
        let obj={}
        for(let i=0; i<srt.length; i++){
            if(obj[srt[i]]){
                obj[srt[i]]++
            }else{
                obj[srt[i]]=1
            }
        }
        console.log(obj)
    </script>
</body>
</html>